<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue'

export default {
  data() {
    return {
      cdata: {
        xData: [],
        seriesData: []
      }
    };
  },
  components: {
    Chart,
  },
  mounted() {
    this.setData();
  },
  methods: {
    setData() {
      // 使用前5条工单数据
      const data = [
        { name: '2666R2把手', value: 1000 },
        { name: '1293把手', value: 400 },
        { name: '2878把手', value: 1000 },
        { name: '1293把手', value: 1000 },
        { name: 'BH有孔底板', value: 9000 }
      ];

      this.cdata.xData = data.map(item => item.name);
      this.cdata.seriesData = data;
    }
  }
};
</script>

<style lang="scss" scoped>
</style>